/**
**************************************************************************************
*Founder Effect                                                                      *
*Copyright (C) 2006-2007, 5d Studios (www.5d-Studios.com)                            *
*                                                                                    *
*This library is free software; you can redistribute it and/or                       *
*modify it under the terms of the GNU Lesser General Public                          *
*License as published by the Free Software Foundation; either                        *
*version 2.1 of the License, or (at your option) any later version.                  *
*                                                                                    *
*This library is distributed in the hope that it will be useful,                     *
*but WITHOUT ANY WARRANTY; without even the implied warranty of                      *
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                   *
*Lesser General Public License for more details.                                     *
*                                                                                    *
*You should have received a copy of the GNU Lesser General Public                    *
*License along with this library; if not, write to the Free Software                 *
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA      *
**************************************************************************************
*/
#pragma once

extern "C" {
 	#include <lua.h>
 	#include <lualib.h>
 	#include <lauxlib.h>
}

/**
===========================
Bind functions for LUA scripts -
mainly used for Missions.
===========================
*/
class Player;
class LUA_Player
{
public:
    LUA_Player(void);

    /** Inialize the player */
    static int Init( lua_State *L );
    /** Set the face of the entity */
    static int SetFace( lua_State *L );
    /** Set the name of the entity */
    static int SetName( lua_State *L );
    /** Set the state of the entity */
    static int SetState( lua_State *L );
    /** Set the position of the entity */
    static int SetPosition( lua_State *L );
    /** Set the speed */
    static int SetVelocity( lua_State *L );
    /** Add a state */
    static int AddState( lua_State *L );

    /** Get the face of the entity */
    static int GetFace( lua_State *L );
    /** Get the name of the entity */
    static int GetName( lua_State *L );
    /** Get the position of the entity */
    static int GetPosX( lua_State *L );
     /** Get the position of the entity */
    static int GetPosY( lua_State *L );
    /** Get the speed */
    static int GetSpeed( lua_State *L );

    /** Get the state of the entity */
    static int GetCurrentState( lua_State *L );

    /** Give the Player an item */
    static int GiveItem( lua_State *L );

    /** Disable the player from moving from input */
    static int EnableInput( lua_State *L );

    /*------------------------------------------------
        Mission Handling 
    ------------------------------------------------*/

    /** Check the status of a mission */
    static int CheckMissionStatus( lua_State *L );
    /** Check to see if this mission exists */
    static int HasMission( lua_State *L );
    /** Set the status of a mission */
    static int SetMissionStatus( lua_State *L );

    static const luaL_reg methods[];
private:
    // reference to the player
    static Player* m_player;
public:
    virtual ~LUA_Player(void);
};
